using UnityEngine;

public class CharacterStayInDimension : MonoBehaviour
{
	public enum Type
	{
		position,
		rotation,
		positionAndRotation
	}

	public Type type;

	private void LateUpdate()
	{
		if (type == Type.position || type == Type.positionAndRotation)
		{
			Transform transform = base.transform;
			Vector3 position = base.transform.position;
			float y = position.y;
			Vector3 position2 = base.transform.position;
			transform.position = new Vector3(0f, y, position2.z);
		}
		if (type == Type.rotation || type == Type.positionAndRotation)
		{
			Transform transform2 = base.transform;
			Vector3 forward = base.transform.parent.forward;
			float y2 = forward.y;
			Vector3 forward2 = base.transform.parent.forward;
			transform2.rotation = Quaternion.LookRotation(new Vector3(0f, y2, forward2.z));
		}
	}
}
